﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Data;
using Utility;

namespace DataAccess
{
   public class LoginControl
    {
       eLearningDataContext context = new eLearningDataContext();

       public tbl_student studentLogin(string user, string pass)
       {
           var gt = (from st in context.tbl_students
                     where st.username.Equals(user) && st.password.Equals(pass) 
                     select st).Single();

           return gt;
       }

       public tbl_teacher teacherlogin(string user, string pass)
       {
           var gt = (from st in context.tbl_teachers
                     where st.username.Equals(user) && st.password.Equals(pass)
                     select st).Single();

           return gt;
       }

       public tbl_admin adminlogin(string user, string pass)
       {
           var gt = (from st in context.tbl_admins
                     where st.username.Equals(user) && st.password.Equals(pass)
                     select st).Single();

           return gt;
       }

    }
}
